package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TravelQuery extends QueryObject{

    private Long destId = -1L;
    private int dayType = -1;
    private int travelTimeType = -1;//月份
    private int perExpendType = -1; //人均
    private int orderType = 1;//最新

    public String getOrderBy(){
        return orderType == 2 ? "t.viewnum desc" : "t.createTime desc";
    }


    public TravelCondition getDay(){
        return TravelCondition.TRAVEL_DAY.get(dayType);
    }
    //月份
    public TravelCondition getTime(){
        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }
    //人均消费
    public TravelCondition getPerExpend(){
        return TravelCondition.TRAVEL_PRE_EXPENDS.get(perExpendType);
    }


}
